package com.canic.dkd.authorization.staff.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.canic.dkd.authorization.staff.entity.SysPermission;
import com.canic.dkd.authorization.staff.entity.SysRole;
import com.canic.dkd.authorization.staff.mapper.SysPermissionMapper;
import com.canic.dkd.authorization.staff.service.SysPermissionService;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * 权限
 * @author ZC
 * @since 2019-05-02
 */
@Service
public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, SysPermission> implements SysPermissionService {

    @Override
    public List<SysRole> getRoleListByPermissionUrl(String permissionUrl) {
        List<SysRole> list = baseMapper.getRoleListByPermissionUrl(permissionUrl);
        if(CollectionUtils.isEmpty(list)){
            return Lists.newArrayList();
        }
        return list;
    }
}
